extends State
class_name PlayerSpecial

@onready var player_sprite: AnimatedSprite2D = $"../../PlayerSprite"

var gravity = Autoload.gravity

func enter():
	print("进入特殊cg")
	player_sprite.play("dead1")
	var tweenx:Tween = get_tree().create_tween().set_parallel(true)
	var tweeny:Tween = get_tree().create_tween()
	tweenx.tween_property(character,"global_position:x",1361.0,1.5).set_trans(Tween.TRANS_LINEAR)
	tweeny.tween_property(character,"global_position:y",character.global_position.y-50,0.5).set_trans(Tween.TRANS_QUAD)
	tweeny.tween_property(character,"global_position:y",250.0,1.0).set_trans(Tween.TRANS_QUAD)	

func update(delta):
	await get_tree().create_timer(1.5).timeout
	player_sprite.play("dead2")
	await get_tree().create_timer(2.0).timeout
	if Autoload.stage_show == false:
		transition_requested.emit("Playeridle")
	
	
